package com.ymatou.iapi.captcha.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.ValidateCodeServiceV2;
import com.ymttest.database.model.ValidationCode;
import com.ymttest.database.model.YmtValidationCode;
import com.ymttest.database.sqlwapper.YmtValidationCodeWapperV2;
import com.ymttest.utils.TestDataManager;

import com.ymatou.iapi.captcha.parameter.*;
import com.ymatou.iapi.captcha.service.*;
/**
*校验验证码并保持有效用例
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_ConfirmValidateCodeAndKeepNormal{
	private static ConfirmValidateCodeAndKeepNormalBean confirmValidateCodeAndKeepNormalBean;
	private static ConfirmValidateCodeAndKeepNormalCall ConfirmValidateCodeAndKeepNormalCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("校验验证码并保持有效用例");
	}

	@Before
	public void caseUp() {
		confirmValidateCodeAndKeepNormalBean=new ConfirmValidateCodeAndKeepNormalBean();
		ConfirmValidateCodeAndKeepNormalCall=new ConfirmValidateCodeAndKeepNormalCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(ConfirmValidateCodeAndKeepNormalCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_001() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度>=32-验证通过");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmValidateCodeAndKeepNormalBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();

			Logger.verifyEquals("200", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证通过", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("true", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyIsNull(ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(200, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_002() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度<32-验证码格式错误");
		try {

			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 20,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmValidateCodeAndKeepNormalBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();

			Logger.verifyEquals("600", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyIsContains("验证码格式错误", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyIsNull(ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");			
			
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(0, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_003() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度>=32-验证码已验证过");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			ConfirmValidateCodeBean confirmValidateCodeBean = new ConfirmValidateCodeBean();
			ConfirmValidateCodeCall confirmValidateCodeCall = new ConfirmValidateCodeCall();					

			confirmValidateCodeBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmValidateCodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmValidateCodeCall.setData(confirmValidateCodeBean);
			confirmValidateCodeCall.callService();			

			confirmValidateCodeAndKeepNormalBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());	
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();
			
			Logger.verifyEquals("300", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码已失效", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyIsNull(ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(200, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_004() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度>=32-验证码错误");
		try {
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmValidateCodeAndKeepNormalBean.setValidateCode("1234567890123456789012345678901234567890");
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();		
			
			Logger.verifyEquals("100", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码错误", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyIsNull(ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(0, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");
	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_005() {
		Logger.start(true,"校验验证码-验证主体为非空-验证通过");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 4,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmValidateCodeAndKeepNormalBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmValidateCodeAndKeepNormalBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();

			Logger.verifyEquals("200", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证通过", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("true", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(getvalidatecodeBean.getActionUser(), ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(200, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");
		
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_006() {
		Logger.start(true,"校验验证码-验证主体为非空-验证码已验证过");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 4,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			ConfirmValidateCodeBean confirmValidateCodeBean = new ConfirmValidateCodeBean();
			ConfirmValidateCodeCall confirmValidateCodeCall = new ConfirmValidateCodeCall();					

			confirmValidateCodeBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmValidateCodeBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmValidateCodeBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			confirmValidateCodeCall.setData(confirmValidateCodeBean);
			confirmValidateCodeCall.callService();			

			confirmValidateCodeAndKeepNormalBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmValidateCodeAndKeepNormalBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();
			
			Logger.verifyEquals("300", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码已失效", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(getvalidatecodeBean.getActionUser(), ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(200, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_007 () {
		Logger.start(true,"校验验证码-验证主体为非空-验证码错误");
		try {

			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 4,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmValidateCodeAndKeepNormalBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmValidateCodeAndKeepNormalBean.setValidateCode("123");
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();
			
			Logger.verifyEquals("100", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码错误", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(getvalidatecodeBean.getActionUser(), ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(0, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_008() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度>=32-验证码已失效");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			new YmtValidationCodeWapperV2().setiValidateStatus(getValidateCodeCall.getValidateCode(), -1);
			confirmValidateCodeAndKeepNormalBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();

			Logger.verifyEquals("300", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码已失效", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyIsNull(ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(-1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(300, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_009() {
		Logger.start(true,"校验验证码-验证主体为非空，-验证码已失效");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 4,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			new YmtValidationCodeWapperV2().setiValidateStatus(getValidateCodeCall.getValidateCode(), -1);
			
			confirmValidateCodeAndKeepNormalBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmValidateCodeAndKeepNormalBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();

			Logger.verifyEquals("300", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证码已失效", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(getvalidatecodeBean.getActionUser(), ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(-1, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(300, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_010 () {
		Logger.start(true,"校验验证码-验证主体为非空-验证码验证错误-400");
		try {

			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 4,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmValidateCodeAndKeepNormalBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();
			
			Logger.verifyEquals("400", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyIsContains("错误", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("false", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(getvalidatecodeBean.getActionUser(), ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(0, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_011() {
		Logger.start(true,"校验验证码-验证主体为空，有效验证码需要长度>=32-验证码空-500");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			
			confirmValidateCodeAndKeepNormalBean.setValidateType(getvalidatecodeBean.getValidateType());
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();

			Logger.verifyEquals("400", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyIsContains("验证码错误", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ConfirmValidateCodeAndKeepNormal_012() {
		Logger.start(true,"校验验证码-type-1000验证通过");
		try {
			
			GetValidateCodeBean getvalidatecodeBean = new ValidateCodeServiceV2().setGetValidateCodeBean(1, null, 64,TestDataManager.getRandomNum(10), TestDataManager.getRandomIntNum(2));
			GetValidateCodeCall getValidateCodeCall = new ValidateCodeServiceV2().GetValidateCode(getvalidatecodeBean);
			confirmValidateCodeAndKeepNormalBean.setActionUser(getvalidatecodeBean.getActionUser());
			confirmValidateCodeAndKeepNormalBean.setValidateCode(getValidateCodeCall.getValidateCode());
			confirmValidateCodeAndKeepNormalBean.setValidateType(-1000);
			
			ConfirmValidateCodeAndKeepNormalCall.setData(confirmValidateCodeAndKeepNormalBean);
			ConfirmValidateCodeAndKeepNormalCall.callService();

			Logger.verifyEquals("200", ConfirmValidateCodeAndKeepNormalCall.getCode(), "验证返回code");
			Logger.verifyEquals("验证通过", ConfirmValidateCodeAndKeepNormalCall.getMessage(), "验证返回Message");
			
			Logger.verifyEquals("true", ConfirmValidateCodeAndKeepNormalCall.getIsValidate(), "验证返回IsValidate");
			Logger.verifyEquals(confirmValidateCodeAndKeepNormalBean.getActionUser(),ConfirmValidateCodeAndKeepNormalCall.getActionUser(), "验证返回ActionUser");
		
			// 验证数据库落地正确
			ValidationCode validationCode = new YmtValidationCodeWapperV2().getByActionUserAndValidateType(getvalidatecodeBean.getActionUser(), getvalidatecodeBean.getValidateType()).get(0);
			Logger.verifyEquals(getValidateCodeCall.getValidateCode(), validationCode.getCode(), "验证数据库表Ymt_ValidationCode中字段sValidateCode");
			Logger.verifyEquals(0, validationCode.getStatus(), "验证数据库表Ymt_ValidationCode中字段Ivalidatestatus");
			Logger.verifyEquals(200, validationCode.getResult(), "验证数据库表Ymt_ValidationCode中字段iValidateResult");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}